package com.vcs.web;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

public class TimerInterceptor implements Interceptor {

	public static final Log log = LogFactory.getLog(TimerInterceptor.class);

	@Override
	public void destroy() {
		log.info("TIMER INTERCEPTOR : DESTROY METHOD ");
	}

	@Override
	public void init() {
		log.info("TIMER INTERCEPTOR : INIT METHOD");
	}

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		log.info("TIMER INTERCEPTOR : INTERCEPT METHOD");
		log.info("Date is : " + new Date());
		return invocation.invoke();
	}

}
